package com.neno.producer.hello;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


/**
 * @Author: root
 * @Date: 2018/11/9 0:25
 */
@Component
public class HelloProducer {
    @Autowired
    private AmqpTemplate rabbitmqTemplate;

    public void send(String date) {
        String context = "hello " + date;
        System.out.println("producer : " + context);
        this.rabbitmqTemplate.convertAndSend("hello", context.toString());
    }
}
